<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="com.ks.app.navigate.hibernate.KsWebsite"%>
<%@ include file="/commons/taglibs.jsp" %>
<%@ page import="java.util.*" %>
<html>
<head>
	 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	 <meta name="viewport" content="target-densitydpi=device-dpi" />
	 <title>导航站点</title> 
	 <link href="${css}/newcss/website.css" rel="stylesheet" type="text/css" />
</head>

<body class="bg1">
	<%
				List<KsWebsite> list = (List<KsWebsite>)request.getAttribute("weblist");
				String nav           = String.valueOf(request.getAttribute("navi"));
				int col = 0;	
				int j   = 0;	
				if(list != null && list.size()>0){
					j= list.size()%3;
					col = j==0?list.size()/3:list.size()/3+1;
				}		
	%>
	<div>
		<div class="but01"><%=nav%>————相关站点</div>
	</div>

	<div class="lists2">
					<div class="boxs3">
						<table width="100%">
							<%
								 for(int i=0;i<col;i++){
								 	int t = i%2+1;
								 	if(i < col-1){
								 		KsWebsite k1 = list.get(i*2);
								 		KsWebsite k2 = list.get(i*2+1);
								 		KsWebsite k3 = list.get(i*2+2);	
						    %>
											 <tr class="t<%=t%>">
												<td width="33%" align="left" height="30px;"><a href="<%=k1.getUrl() %>"><%=k1.getName()%></a></td>
												<td width="34%" align="left"><a href="<%=k2.getUrl() %>"><%=k2.getName() %></a></td>
												<td width="33%" align="left"><a href="<%=k3.getUrl() %>"><%=k3.getName() %></a></td>
											 </tr>			
							<% 		
									}else{
										if(j==0){
											KsWebsite k1 = list.get(i*2);
									 		KsWebsite k2 = list.get(i*2+1);
									 		KsWebsite k3 = list.get(i*2+2);	
							%>
										     <tr class="t<%=t%>">
												<td width="33%" align="left" height="30px;"><a href="<%=k1.getUrl() %>"><%=k1.getName()%></a></td>
												<td width="34%" align="left"><a href="<%=k2.getUrl() %>"><%=k2.getName() %></a></td>
												<td width="33%" align="left"><a href="<%=k3.getUrl() %>"><%=k3.getName() %></a></td>
											 </tr>	
						    <%
										}else if(j==1){
											KsWebsite k1 = list.get(i*2);
							%>			
										 <tr class="t<%=t%>">
											<td width="33%" align="left" height="30px;"><a href="<%=k1.getUrl() %>"><%=k1.getName()%></a></td>
											<td width="34%" align="left"></td>
											<td width="33%" align="left"></td>
										 </tr>	
							<% 
										}else if(j==2){
											KsWebsite k1 = list.get(i*2);
									 		KsWebsite k2 = list.get(i*2+1);
							%>
									 	<tr class="t<%=t%>">
											<td width="33%" align="left" height="30px;"><a href="<%=k1.getUrl() %>"><%=k1.getName()%></a></td>
											<td width="34%" align="left"><a href="<%=k2.getUrl() %>"><%=k2.getName() %></a></td>
											<td width="33%" align="left"></td>
										</tr>
							<% 
										}
									}		
								}		
							%>
						</table>
					</div>
			</div>
</body>
</html>